define(function (require, exports, module) {

    exports.coursewareApi_addFoloder = function (courseid, foldername, callback, parentid) {
        var data={
            "status": 1,
            "data": {
                "id": "shuji",
                "candownload": "1",
                "createtime": "1567583450",
                "isfolder": "1",
                "foldername": foldername,
                "sort": "0",
                "courseid": "384932",
                "ext": "\.\.\/\.\.\/static\/test\/ziy\/img\/file_ext_big_folder.png",
                "filenums": "0",
                "ext_s": "\/static\/test\/ziy\/img\/file_ext_big_folder.png",
                "url": "3423",
                "rurl": "",

            },
            "role": 1,
            "info": "添加成功"
        };
        callback(data);


        // var data = {courseid: courseid, foldername: foldername, parentid: parentid};
        // $.ajax({
        //     type: "POST",
        //     url:
        //     data: data,
        //     dataType: "json",
        //     success: function (data) {
        //         if (data.status == 1) {
        //             if (callback != null) {
        //                 callback(data)
        //             }
        //         } else {
        //             plugin.openMsg(data.info, 1)
        //         }
        //     }
        // })
    };


    exports.coursewareApi_getCousewareList = function (courseid, isfolder, callback) {
        var data={
            "status":1,
            "lists":[
            {
                "id":"MDAwMDAwMDAwMLOstZmIudGvhMtyoQ",
                "uid":"3506268",
                "candownload":"1",
                "createtime":"1567388601",
                "isfolder":"1",
                "foldername":"文件夹名",
                "sort":"0",
                "courseid":"384932",
                "ext":"../../static/test/ziy/img/file_ext_big_folder.png",
                "filenums":"1",
                "ext_s":"/Public/Common/img/fileiconv2/file_ext_small_folder.png",
                "url": "",
                "rurl":""
            }
        ],
            "info":"success"
        };
        callback(data);
        // var data = {courseid: courseid, isfolder: isfolder};
        // $.ajax({
        //     type: "GET",
        //     url: exports.APIURL + "/CoursewareApi/getCousewareList",
        //     data: data,
        //     dataType: "json",
        //     success: function (data) {
        //         if (data.status == 1) {
        //             if (callback != null) {
        //                 callback(data)
        //             }
        //         } else {
        //             plugin.openMsg(data.info, 1)
        //         }
        //     }
        // })
    };

    exports.ResourceCoursewareApi_listAllCourseware = function (rid, callback) {
        var data= {"status":1,"info":"success","lists":[],"courewareCount":"0","role":"1"};
        callback(data);
        // var data = {rid: rid};
        // $.ajax({
        //     type: "GET",
        //     url: exports.APIURL + "/ResourceCoursewareApi/listAllCourseware",
        //     data: data,
        //     dataType: "json",
        //     success: function (data) {
        //         if (data.status == 1) {
        //             if (callback != null) {
        //                 callback(data)
        //             }
        //         } else {
        //             plugin.openMsg(data.info, 1)
        //         }
        //     }
        // })
    };
    exports.ResourceApi_getResourceList = function (callback) {
      var data=  {
          "status":1,
          "data":[
              {
              "id":"MDAwMDAwMDAwMLOsuZeHubt1",
              "title":"\u6211\u7684\u5907\u8bfe\u533a",
              "createtime":"1561602305",
              "type":"0",
              "description":"",
              "groupid":""
              },
              {"id":"MDAwMDAwMDAwMLOsy9yHz6d1",
                  "title":"\u5907\u8bfe\u533a\u540d\u79f0",
                  "createtime":"1567387844",
                  "type":"0",
                  "description":"",
                  "groupid":""
              }
              ]
          ,
          "info":"success"
      }
      callback(data)
       // var data = {};
        // $.ajax({
        //     type: "get",
        //     url: exports.APIURL + "/ResourceApi/getResourceList",
        //     data: data,
        //     dataType: "json",
        //     success: function (data) {
        //         if (data.status == 1) {
        //             if (callback != null) {
        //                 callback(data)
        //             }
        //         } else {
        //             plugin.openMsg(data.info, 1)
        //         }
        //     }
        // })
    };
    exports.coursewareApi_getImportList = function (isfolder, callback) {
        var data={
            "status":1,
            "lists":[
                {
                    "id":"MDAwMDAwMDAwMLOsy5SIubOx",
                    "coursename":"\u8bfe\u7a0b\u540d\u79f0",
                    "bannercolor":"#318eeb"},
                {"id":"MDAwMDAwMDAwMLOsx92Hqb9s",
                    "coursename":"test\u8bfe\u7a0b",
                    "bannercolor":"#318eeb"},
                {"id":"MDAwMDAwMDAwMLOsx92G37Ow",
                    "coursename":"\u5468\u52c7\u7814\u7a76\u5b66",
                    "bannercolor":"#318eeb"},
                {"id":"MDAwMDAwMDAwMLOsx92G369r",
                    "coursename":"\u719f\u6089  \u8bfe\u5802\u6d3e",
                    "bannercolor":"#318eeb"}],
            "info":"success"
        }
        callback(data);
        // var data = {isfolder: isfolder};
        // $.ajax({
        //     type: "GET",
        //     url: exports.APIURL + "/CoursewareApi/getImportList",
        //     data: data,
        //     dataType: "json",
        //     success: function (data) {
        //         if (data.status == 1) {
        //             if (callback != null) {
        //                 callback(data)
        //             }
        //         } else {
        //             plugin.openMsg(data.info, 1)
        //         }
        //     }
        // })
    };
    exports.ResourceCoursewareApi_folder = function (folderid, callback) {
        var data= {"status":1,"info":"success","lists":[],"courewareCount":"0","role":"1"};
        callback(data);
    }
    //     var data = {folderid: folderid};
    //     $.ajax({
    //         type: "GET",
    //         url: exports.APIURL + "/ResourceCoursewareApi/folder",
    //         data: data,
    //         dataType: "json",
    //         success: function (data) {
    //             if (data.status == 1) {
    //                 if (callback != null) {
    //                     callback(data)
    //                 }
    //             } else {
    //                 plugin.openMsg(data.info, 1)
    //             }
    //         }
    //     })
    // };
    exports.coursewareApi_folder = function (folderid, callback) {
        var data= {"status":1,"info":"success","lists":[],"courewareCount":"0","role":"1"};
        callback(data);
    }
    //     var data = {folderid: folderid};
    //     $.ajax({
    //         type: "GET",
    //         url: exports.APIURL + "/CoursewareApi/folder",
    //         data: data,
    //         dataType: "json",
    //         success: function (data) {
    //             if (data.status == 1) {
    //                 if (callback != null) {
    //                     callback(data)
    //                 }
    //             } else {
    //             }
    //         }
    //     })
    // };
})
